package api

import (
	"github.com/gin-gonic/gin"
	"shop-api/internal/server"
)

func GoodTypeList(c *gin.Context) {
	type Req struct {
		Position uint `json:"position"`
	}

	req := new(Req)
	if err := c.ShouldBindJSON(&req); err != nil {
		Resp(c, nil, err)
		return
	}

	info, err := server.GetGoodType(req.Position)
	if err != nil {
		Resp(c, nil, err)
		return
	}
	Resp(c, info, nil)
	return
}
